package it.hopeless.jee6.decorator;

import it.hopeless.jee6.conversation.Collector;
import it.hopeless.jee6.conversation.LetterCollector;
import it.hopeless.jee6.conversation.SaveLetter;

import javax.decorator.Decorator;
import javax.decorator.Delegate;
import javax.enterprise.inject.Any;
import javax.inject.Inject;

@Decorator
public class SaveLetterCollectorUpperCase extends LetterCollector {

    @Inject
    @Delegate
    @Any
    @SaveLetter
    Collector collector;

    public String getSortedText() {
        return collector.getSortedText().toUpperCase();
    }

    @Override
    public void setText(String text) {
        collector.setText(text);
    }

    @Override
    public String getText() {
        return collector.getText();
    }

    @Override
    public String getAddedText() {
        return collector.getAddedText();
    }

    @Override
    public void sort() {
        collector.sort();
    }

    @Override
    public String getLettersText() {
        return collector.getLettersText();    
    }
}
